#ifndef __ZUIBUTTON_H__
#define __ZUIBUTTON_H__

#include "ZLabel.h"

namespace ZuiLib
{

class ZButton : public ZLabel
{
public:
	ZUI_CLASS_NAME("zui.Button");
	ZButton();
	~ZButton();

	const char* GetClass() const ZOVERRIDE;
	void* GetInterface(const char* pstrName) ZOVERRIDE;
	uint32_t GetControlFlags() const ZOVERRIDE;

	bool Activate() ZOVERRIDE;
	void SetEnabled(bool bEnable = true) ZOVERRIDE;
	void DoEvent(TEventUI& event) ZOVERRIDE;

	const char* GetNormalImage();
	void SetNormalImage(const char* pStrImage);
	const char* GetHotImage();
	void SetHotImage(const char* pStrImage);
	const char* GetPushedImage();
	void SetPushedImage(const char* pStrImage);
	const char* GetFocusedImage();
	void SetFocusedImage(const char* pStrImage);
	const char* GetDisabledImage();
	void SetDisabledImage(const char* pStrImage);

	void SetHotTextColor(color_t dwColor);
	color_t GetHotTextColor() const;
	void SetPushedTextColor(color_t dwColor);
	color_t GetPushedTextColor() const;
	void SetFocusedTextColor(color_t dwColor);
	color_t GetFocusedTextColor() const;
	SIZE EstimateSize(SIZE szAvailable) ZOVERRIDE;
	void SetAttribute(const char* pstrName, const char* pstrValue) ZOVERRIDE;

	void PaintText(ZRenderer* hDC) ZOVERRIDE;
	void PaintStatusImage(ZRenderer* hDC) ZOVERRIDE;

//signal:
	sigslot::signal1<ZButton*> SignalClick;
	sigslot::signal1<ZButton*> SignalMouseDown;
	sigslot::signal1<ZButton*> SignalMouseUp;
protected:
	uint32_t m_uButtonState;
	color_t m_dwHotTextColor;
	color_t m_dwPushedTextColor;
	color_t m_dwFocusedTextColor;

	ZImageDrawInfo m_sNormalImage;
	ZImageDrawInfo m_sHotImage;
	ZImageDrawInfo m_sPushedImage;
	ZImageDrawInfo m_sFocusedImage;
	ZImageDrawInfo m_sDisabledImage;
};


}//namespace

#endif